package com.smbms.service.impl;

import com.smbms.dao.UserMapper;
import com.smbms.pojo.User;
import com.smbms.service.UserService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;
    @Override
    public User getUserByLogin(Map<String,Object> paramsMap) {
        return userMapper.getUserByLogin(paramsMap);
    }

    @Override
    public int getUserCount(String userName, Integer userRole) {
        return userMapper.getUserCount(userName,userRole);
    }

    @Override
    public List<User> getUserList(String userName, Integer userRole, Integer start, Integer pageSize) {
        return userMapper.getUserList(userName,userRole,start,pageSize);
    }

    @Override
    public int delUser(Integer id) {
        return userMapper.delUser(id);
    }

    @Override
    public int getCountByUserCode(String userCode) {
        return userMapper.getCountByUserCode(userCode);
    }

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public User getUserById(Integer id) {
        return userMapper.getUserById(id);
    }

    @Override
    public int getCountByUserCodeAndId(String userCode, Integer id) {
        return userMapper.getCountByUserCodeAndId(userCode,id);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }

    @Override
    public List<User> getUserList2(String userName, Integer userRole) {
        return userMapper.getUserList2(userName,userRole);
    }
}
